Repository navigation
Fix filter chains with different filter regions - #1144
Merged
Merged
Conversation
Collaborator
|
Hmm, I will have to check, but I suspect this is just a band-aid fix and doesn't fix a (possibly) more fundamental issue in the current code. |
Filter inputs could retain the full layer dimensions while outputs used the smaller filter region, causing out-of-bounds writes. Crop the source to the working region, adjust its coordinate origin, and place the result back at the original offset. This also preserves clipping for chained filters with different regions. Fixes linebender#1141.
LaurenzV
force-pushed
the
fix-lighting-region-mismatch
branch
from
October 7, 2026 19:10
0020241 to
5bcece6
Compare
Collaborator
|
Okay honestly, I'm also not 100% confident here, it's very hard to wrap my head around the filter code. But I believe there was a more general issue: Each filter assumes that the input and output region are the same, but that doesn't have to be the case if two filter's in a chain cover different regions. I've added some code to first crop it in case they don't match, which fixes your issue and another issue I've found. Not super efficient, but we only pay the cost in that specific situation, the normal case remains unchanged, so hopefully good enough. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tiny elements with a lighting filter crashed because rounding made the filter area 1px smaller than the input. The output now matches the input size.
Fixes #1141
LLM Contributions: investigation, implementation and tests with Claude Code, reviewed by me. The description is my own, edited for grammar.